home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / basic / qbnws101.zip / SCRNSUBS.BAS < prev   
BASIC Source File  |  1989-10-31  |  2KB  |  60 lines

  1. DEFINT A-Z
  2. DECLARE SUB MemCopy ALIAS "B$ASSN" (BYVAL FSeg%, BYVAL FOfs%, BYVAL NBytes1%, BYVAL TSeg%, BYVAL TOfs%, BYVAL NBytes2%)
  3.  
  4. 'This declare statement must appear in you program
  5.  
  6. SUB ScrRest (Buffer(), Page) STATIC
  7.  
  8. DEF SEG = 0                            'First, we are going to check to
  9. MonType = PEEK(&H463)                  'see if we have a color or mono
  10. DEF SEG
  11.  
  12. IF MonType = &HB4 THEN                 'monitor. If MonType is B4 then
  13.    ToSeg = &HB000                      'we have a mono. Set display segment.
  14.    IF Page <> 1 THEN                   'Only 1 page with mono monitor
  15.       Page = -1                        'Exit with error by setting Page
  16.       EXIT SUB                         'to -1.
  17.    END IF
  18. ELSE
  19.    ToSeg = &HB800                      'Else we have a color.
  20. END IF
  21.  
  22. ToOfs = (Page - 1) * &H1000            'Adjust offset for correct page
  23.  
  24. FromSeg = VARSEG(Buffer(1))            'Get segment of array
  25. FromOfs = VARPTR(Buffer(1))            'And offset
  26.  
  27. NumBytes = 4000                        'Each page contains 4000 bytes.
  28.  
  29. CALL MemCopy(FromSeg, FromOfs, NumBytes, ToSeg, ToOfs, NumBytes)
  30.  
  31. END SUB
  32.  
  33. SUB ScrSave (Buffer(), Page) STATIC
  34.  
  35. DEF SEG = 0                            'First, we are going to check to
  36. MonType = PEEK(&H463)                  'see if we have a color or mono
  37. DEF SEG
  38.  
  39. IF MonType = &HB4 THEN                 'monitor. If MonType is B4 then
  40.    FromSeg = &HB000                    'we have a mono. Set display segment.
  41.    IF Page <> 1 THEN                   'Only 1 page with mono monitor
  42.       Page = -1                        'Exit with error by setting Page
  43.       EXIT SUB                         'to -1.
  44.    END IF
  45. ELSE
  46.    FromSeg = &HB800                    'Else we have a color.
  47. END IF
  48.  
  49. FromOfs = (Page - 1) * &H1000          'Adjust offset for correct page
  50.  
  51. ToSeg = VARSEG(Buffer(1))              'Get segment of array
  52. ToOfs = VARPTR(Buffer(1))              'And offset
  53.  
  54. NumBytes = 4000                        'Each page contains 4000 bytes.
  55.  
  56. CALL MemCopy(FromSeg, FromOfs, NumBytes, ToSeg, ToOfs, NumBytes)
  57.  
  58. END SUB                                'Capture screen and return
  59.  
  60.